package com.ruoyi.cmdb.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cmdb.mapper.TbEmployeeMapper;
import com.ruoyi.cmdb.domain.TbEmployee;
import com.ruoyi.cmdb.service.ITbEmployeeService;

/**
 * 雇员列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-25
 */
@Service
public class TbEmployeeServiceImpl implements ITbEmployeeService 
{
    @Autowired
    private TbEmployeeMapper tbEmployeeMapper;

    /**
     * 查询雇员列表
     * 
     * @param id 雇员列表主键
     * @return 雇员列表
     */
    @Override
    public TbEmployee selectTbEmployeeById(String id)
    {
        return tbEmployeeMapper.selectTbEmployeeById(id);
    }
    /**
     * 查询雇员列表
     *
     * @param name 雇员列表主键
     * @return 雇员列表
     */
    @Override
    public TbEmployee selectTbEmployeeByName(String name)
    {
        return tbEmployeeMapper.selectTbEmployeeByName(name);
    }

    /**
     * 查询雇员列表列表
     * 
     * @param tbEmployee 雇员列表
     * @return 雇员列表
     */
    @Override
    public List<TbEmployee> selectTbEmployeeList(TbEmployee tbEmployee)
    {
        return tbEmployeeMapper.selectTbEmployeeList(tbEmployee);
    }

    /**
     * 新增雇员列表
     * 
     * @param tbEmployee 雇员列表
     * @return 结果
     */
    @Override
    public int insertTbEmployee(TbEmployee tbEmployee)
    {
        tbEmployee.setCreateTime(DateUtils.getNowDate());
        return tbEmployeeMapper.insertTbEmployee(tbEmployee);
    }

    /**
     * 修改雇员列表
     * 
     * @param tbEmployee 雇员列表
     * @return 结果
     */
    @Override
    public int updateTbEmployee(TbEmployee tbEmployee)
    {
        tbEmployee.setUpdateTime(DateUtils.getNowDate());
        return tbEmployeeMapper.updateTbEmployee(tbEmployee);
    }

    /**
     * 批量删除雇员列表
     * 
     * @param ids 需要删除的雇员列表主键
     * @return 结果
     */
    @Override
    public int deleteTbEmployeeByIds(String[] ids)
    {
        return tbEmployeeMapper.deleteTbEmployeeByIds(ids);
    }

    /**
     * 删除雇员列表信息
     * 
     * @param id 雇员列表主键
     * @return 结果
     */
    @Override
    public int deleteTbEmployeeById(String id)
    {
        return tbEmployeeMapper.deleteTbEmployeeById(id);
    }
}
